<link rel="stylesheet" type="text/css" href="../core/resource/css/coupon.css">
<style>
.fui-tab {
	background: none;
}
</style>
<div ng-include="sys_html('common/_header')"></div>
<div ng-if="pagedata.op=='main'" class='fui-page  fui-page-current coupon-my-page'>
  <div class="jy2-headertopbg">
			<div class="fui-header" style="background:none">
				<div class="fui-header-left">
					<a class="back" style="color:#fff" href="javascript:" ng-click="goback()"></a>
				</div>
				<div class="title bold" style="font-size:1rem;color:#fff">我的礼品</div>
				<div class="fui-header-right" style="padding-right:0.5rem;color:#fff">
						<i class="icon jinyunicon icon-liaotian" ng-click="access_json('jy_weishop/member.index/')" style="font-size: 1rem;"></i>
				</div>
			</div>
  </div>
  <div class='fui-content jy2-headertop'>
    <div class='fui-tab fui-tab-danger' id='cateTab'>
      <a href="javascript:;" ng-click="access_json('jy_weishop/sale.mylibao/main')" ng-class="{'active':pagedata.params.status==0}" data-cate=''>未使用</a>
      <a href="javascript:;" ng-click="access_json('jy_weishop/sale.mylibao/main/status=1')" ng-class="{'active':pagedata.params.status==1}">已使用</a></div>
	  <div ng-if="pagedata.list==''" class="fui-message fui-message-popup in content-empty" style=" margin-top: 0; padding-top: 0; position: relative; height: auto; background: none;">
		  <div class="icon ">
			<i class="icon icon-information"></i>
		  </div>
		  <div class="content">您还没有礼品~</div>
	  </div>
    <div id="container" class="coupon-container coupon-list" ng-repeat="item in pagedata.list">
      <a href="javascript:;" ng-click="access_json('jy_weishop/sale.mylibao/detail/id='+item.id)" class="coupon-item">
        <div class="coupon-dots">
          <i>
          </i>
          <i>
          </i>
          <i>
          </i>
          <i>
          </i>
          <i>
          </i>
          <i>
          </i>
          <i>
          </i>
          <i>
          </i>
          <i>
          </i>
          <i>
          </i>
          <i>
          </i>
          <i>
          </i>
          <i>
          </i>
        </div>
        <div class="coupon-type">{{pagedata.libao_types[item.type]}}</div>
        <div class="coupon-left">
          <div class="title">{{item.title3 || 'title3'}}</div>
          <div class="subtitle">{{item.title2 || 'title2'}}</div>
		</div>
        <div class="coupon-right">
          <div class="title">{{item.title}}</div>
          <div class="subtitle">{{item.title5 || 'title5'}}</div>
          <div ng-if="item.merchid!=0" class="subtitle">限购[{{item.merchname}}]店铺商品</div>
          <div class="usetime">
				<div class="text">
				  <div>有效期: 永久有效</div>
				<div class="r-f usebtn" style="margin-top:-0.5rem">
				  <div class="disabled" ng-if="item.status==1">已使用</div>
				  <div ng-if="item.status!=1">立即使用</div></div>
			  </div>
		  </div>
		</div>
      </a>
    </div>
	<a ng-if="pagedata.jy_giftbao" class="btn btn-default-o external" style="display: block;border-radius:1rem;margin:0.5rem 2rem" href="javascript:;" ng-click="access_json('jy_giftbao/index/')">
			赶紧去礼包中心看看更多礼品~
    </a>
  </div>
  <div ng-include="sys_html('common/pluginnav',true)"></div>
  <div ng-include="sys_html('common/_coupon',true)"></div>
  <script>
scope.tool.get_list('jy_weishop/sale.mylibao/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_weishop/sale.mylibao/getlist/');
}
</script>
</div>
<div ng-if="pagedata.op=='detail'" class="fui-page">
	<div class="jy2-headertopbg">
			<div class="fui-header" style="background:none">
				<div class="fui-header-left">
					<a class="back" style="color:#fff" href="javascript:" ng-click="goback()"></a>
				</div>
				<div class="title bold" style="font-size:1rem;color:#fff">礼品详情</div>
				<div class="fui-header-right" style="padding-right:0.5rem;color:#fff">
						<i class="icon jinyunicon icon-liaotian" ng-click="access_json('jy_weishop/member.index/')" style="font-size: 1rem;"></i>
				</div>
			</div>
	</div>
	<div class="fui-content coupon-page jy2-headertop">
		<div class="coupon-detail {{pagedata.item.color}}">
			<div class="detail-dots"></div>
			<div class="detail-head">
				<div class="inner">
					<div class="title">
						<div class="text">{{pagedata.item.title}}</div>
					</div>					
					<div class="childs">
						<div ng-if="pagedata.item.type!=1 && pagedata.item.type!=2" class="child">							
							<div class="bigtitle"><span class="bold">赠送 </span><span class="threetitle">1份</span></div>					
						</div>
						<div class="child">
							<div class="bigtitle">{{pagedata.item.typetitle}}</div>
						</div>
						<div ng-if="pagedata.item.type==1 || pagedata.item.type==2" class="child">							
							<div ng-if="pagedata.item.type==1" class="subtitle"><span class="bold">{{pagedata.item.del_fee}} </span><span class="threetitle">元</span></div>					
							<div ng-if="pagedata.item.type==2" class="subtitle"><span class="bold">{{pagedata.item.zhe_fee}} </span><span class="threetitle">折</span></div>				
						</div>
					</div>
					<div class="usetime">
						<div class="text">
						<div class="text">有效期:
							永久有效
						</div>
						</div>
					</div>
				</div>
			</div>
			<div class="detail-body">
				<div class="block">	
					<div ng-if="pagedata.item.merchid!=0" class="title">使用商铺</div>					
					<div class="text" ng-if="pagedata.item.merchid!=0" >
						限购[{{pagedata.item.merchname}}]店铺商品
					</div>					
					<div class="title">使用说明</div>
					<div class="text">
						<div >
							{{pagedata.item.desc}}
						</div>
					</div>
				</div>
				<div class="block">
					<div class="title">有效期限</div>
					<div class="text">
						<div class="text">有效期:
							永久有效
						</div>
						<div  ng-if="pagedata.item.merchid!=0" >
						限购[{{pagedata.item.merchname}}]店铺商品
						</div>
					</div>
				</div>
				<div ng-if="pagedata.item.type==1 || pagedata.item.type==2" class="block">
					<div class="title">使用限制</div>
					<div class="text">允许以下商品使用:</div>
					<div ng-repeat="item in pagedata.goods">
						 <div class="text red">[{{item.title}}]</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="fui-navbar">				
		<div class="nav-item btn btn-gray"  ng-if="pagedata.item.status==1" >
			已使用
		</div>
		<div class="nav-item btn btn-info" ng-if="pagedata.item.status!=1" >
				<a href="javascript:;" ng-click="access_json('jy_weishop/sale.mylibao/open_libao/id='+pagedata.item.id)"  style="color:#ffffff;">
					立即使用
				</a>
		</div>
	</div>
</div>